package com.lg.mengbase.testBottonTab;

import android.support.v4.app.Fragment;

import com.lg.baselibrary.activity.BaseBottomViewPagerTabActivity;
import com.lg.baselibrary.widget.TabItemView;
import com.lg.mengbase.R;
import com.lg.mengbase.testBottonTab.fragment.TabFragment3;
import com.lg.mengbase.testBottonTab.fragment.TabFragment4;
import com.lg.mengbase.testBottonTab.fragment.TabFragment5;
import com.lg.mengbase.testBottonTab.fragment.TabFragment1;
import com.lg.mengbase.testBottonTab.fragment.TabFragment2;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by LiGang on 2017/5/29.
 * Tabs+ViewPager+Fragment
 */

public class TestBottomTabViewPagerActivity extends BaseBottomViewPagerTabActivity{
    @Override
    protected List<TabItemView> getTabViews() {
        List<TabItemView> tabItemViews = new ArrayList<>();
        tabItemViews.add(new TabItemView(this,"新鲜事",R.color.bottom_tab_text_def,
                R.color.bottom_tab_text_selected2,R.mipmap.tab_newsfeed_default,R.mipmap.tab_newsfeed_pressed));
        tabItemViews.add(new TabItemView(this,"加好友",R.color.bottom_tab_text_def,
                R.color.bottom_tab_text_selected2,R.mipmap.tab_add_friend_default,R.mipmap.tab_add_friend_pressed));
        tabItemViews.add(new TabItemView(this,"兴趣相投",R.color.bottom_tab_text_def,
                R.color.bottom_tab_text_selected2,R.mipmap.tab_match_friend_default,R.mipmap.tab_match_friend_pressed));
        tabItemViews.add(new TabItemView(this,"悄悄话",R.color.bottom_tab_text_def,
                R.color.bottom_tab_text_selected2,R.mipmap.tab_chat_default,R.mipmap.tab_chat_pressed));
        tabItemViews.add(new TabItemView(this,"我的",R.color.bottom_tab_text_def,
                R.color.bottom_tab_text_selected2,R.mipmap.tab_profile_default,R.mipmap.tab_profile_pressed));
        return tabItemViews;
    }

    @Override
    protected List<Fragment> getFragments() {
        List<Fragment> fragments = new ArrayList<>();
        fragments.add(new TabFragment1());
        fragments.add(new TabFragment2());
        fragments.add(new TabFragment3());
        fragments.add(new TabFragment4());
        fragments.add(new TabFragment5());
        return fragments;
    }

    @Override
    protected void initData() {
        showTipCount(3,1);
    }

    @Override
    public boolean onInterceptTabItemSelect(int position) {
        if(position == 3){
            hideTipCount(3);
        }
        return super.onInterceptTabItemSelect(position);
    }
}
